home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH9 / 9-1-2.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  2.1 KB  |  71 lines

  1. VERSION 5.00
  2. Begin VB.Form pic9_1_2 
  3.    Caption         =   "Fixed-length Strings"
  4.    ClientHeight    =   1620
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   3135
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   1620
  20.    ScaleWidth      =   3135
  21.    Begin VB.PictureBox picOutput 
  22.       BeginProperty Font 
  23.          Name            =   "Courier New"
  24.          Size            =   9.75
  25.          Charset         =   0
  26.          Weight          =   700
  27.          Underline       =   0   'False
  28.          Italic          =   0   'False
  29.          Strikethrough   =   0   'False
  30.       EndProperty
  31.       Height          =   1335
  32.       Left            =   840
  33.       ScaleHeight     =   1275
  34.       ScaleWidth      =   2115
  35.       TabIndex        =   1
  36.       Top             =   120
  37.       Width           =   2175
  38.    End
  39.    Begin VB.CommandButton cmdGo 
  40.       Caption         =   "Go"
  41.       Height          =   495
  42.       Left            =   120
  43.       TabIndex        =   0
  44.       Top             =   360
  45.       Width           =   615
  46.    End
  47. Attribute VB_Name = "pic9_1_2"
  48. Attribute VB_GlobalNameSpace = False
  49. Attribute VB_Creatable = False
  50. Attribute VB_PredeclaredId = True
  51. Attribute VB_Exposed = False
  52. Private Sub cmdGo_Click()
  53.   'Illustrate fixed-length strings
  54.   Dim town As String
  55.   Dim city As String * 9
  56.   Dim municipality As String * 12
  57.   town = "Chicago"
  58.   city = "Chicago"
  59.   municipality = "Chicago"
  60.   picOutput.Cls
  61.   If (city = town) Or (city = municipality) Then
  62.       picOutput.Print "same"
  63.     Else
  64.       picOutput.Print "different"
  65.   End If
  66.   picOutput.Print "123456789012345"
  67.   picOutput.Print city & "***"
  68.   picOutput.Print town & "***"
  69.   picOutput.Print municipality & "***"
  70. End Sub
  71.